// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login/login';
// 首页
import index from '@/views/index';
import home from '@/views/home/home';

import orderHandler from '@/views/orderHandler/orderHandler';
import orderOther from '@/views/orderHandler/components/orderOther';
// 启用路由
Vue.use(Router);

// 导出路由 
export default new Router({
    routes: [
    //     {
    //     path: '/',
    //     name: '',
    //     component: index,
    //     hidden: true,
    //     meta: {
    //         requireAuth: false
    //     }
    // }
    {
        path: '/',
        redirect: '/login', // 重定向到 /index 路由
        hidden: true,
      },
    ,  {
        path: '/login',
        component: login,
      }, {
        path: '/index',
        name: '首页',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [
            {
                path: '/home',
                name: '首页啊啊',
                component: home,
                meta: {
                    // requireAuth: true
                }
            },
            {
                path: '/orderHandler',
                name: '订单处理',
                component: orderHandler,
                meta: {
                    // requireAuth: true
                }
            },
            {
                path: '/orderOther',
                name: '其他订单',
                component: orderOther,
                meta: {
                    // requireAuth: true
                }
            },
           ]
    }]
})